package com.share.common.enums;

import lombok.Getter;

/**
 * @author 01401061 - 孙艳强
 * @date 2020/12/4 20:25
 */
@Getter
public enum MethodMenu {
    POST("POST", 0),
    GET("GET", 1);

    public String code;
    public Integer value;

    private MethodMenu(final String code, final Integer value) {
        this.code = code;
        this.value = value;
    }

    public static MethodMenu toEnum(final String code) {
        for (final MethodMenu tag : MethodMenu.values()) {
            if (tag.code.equals(code)) {
                return tag;
            }
        }
        return null;
    }
}
